var FDetail = Vue.component('FDetail', {

    data() {
        return {
            type: 0
        }
    },
    
    template: `<div class="">
                <div class="factory__detail__nav" @click="setTypeFun">
                    <span data-type="0" :class="{spanSelect: type == 0}">产品名录</span>
                    <span data-type="1" :class="{spanSelect: type == 1}">企业介绍</span>
                    <span>>返回客户</span>
                </div>
                <div class="factory__detail__info">
                    <!-- 产品名录 -->
                    <div class="factory__detail__product" v-show="type == 0">
                        <table>
                            <tbody>
                                <tr>
                                    <th colspan="2">针织类</th>
                                </tr>
                                <tr>
                                    <td>
                                        <span>产品名称</span>
                                    </td>
                                    <td>
                                        <span>男装、女装、童装</span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <!-- 企业介绍 -->
                    <div class="factory__detail__company" v-show="type == 1">
                        <table>
                            <tbody>
                                <tr>
                                    <th colspan="2">企业介绍</th>
                                </tr>
                                <tr>
                                    <td>
                                        <span>产品名称</span>
                                    </td>
                                    <td>
                                        <span>男装、女装、童装</span>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                </div>`,

    methods: {
        setTypeFun: function (e) {
            let type = e.target.dataset.type
            this.type = type
        }
    },
})